import { runApp } from 'rax-app';
import cloud from '@tbmp/mp-cloud-sdk';
import {
	setStorageSync,
  removeStorageSync
} from '@/utils/util';

runApp({
  app: {
    cloud,
    globalData: {
      type: 1,
      isShareDouble: false
    },
    onLaunch() {
      removeStorageSync('hasGuide');
      let self = this;
      self.cloud = cloud.init({
        env: 'test',
      });
      // my.hideNavigatorBar();
      my.getSystemInfo({
        success: (res) => {
          self.systemInfo = res;
        }
      });
      self.globalData = {
        templateInfo: {},
        needRelaodFaceprofile: false,
      }
      my.tb.unFavorShop ({
        id: 1652554937,
        success: (res) => {
        },
        fail: (res) => {
        }
      });
    },
    onShow() {
    },
    onShareAppMessage(res) {
      const app = getApp();
      console.log('app', app)
      if (res.from == 'code') {
        app.globalData.isShareDouble = true;
      }
      return {
        title: '快来围观我的写真吧',
        path: '/pages/index/index',
        imageUrl: 'https://jala-test-images.sndaurl.cn/images/share_img.png'
      };  
    },
    
  }
})